package com.breakfast.fun.ui.user.login;

import com.breakfast.fun.base.BaseModel;
import com.breakfast.fun.base.BasePresenter;
import com.breakfast.fun.base.BaseView;
import com.breakfast.fun.data.entity.user.Login;
import com.breakfast.fun.data.entity.user.Result;
import com.breakfast.fun.data.entity.user.UserData;

import java.util.Map;

import retrofit2.http.FieldMap;
import rx.Observable;

/**
 * Created by hp on 2016/8/23.
 */
public interface LoginContract {
    interface Model extends BaseModel {
        Observable<Login> getLoginByPwdModel(@FieldMap Map<String, String> map);

        Observable<Login> getLoginByCodeModel(@FieldMap Map<String, String> map);

        Observable<Result> getRecommendCodeModel(@FieldMap Map<String, String> map);

        Observable<Result> getLoginCodeModel(@FieldMap Map<String, String> map);
    }

    interface View extends BaseView {
        void showLoading();

        void loginSuccess(UserData userData);

        void loginFailure();

        void hideLoading();

        void saveRecommendCode(String code);

        void sendCodeSuccess();

        void openGiftActivity();
    }

    abstract class Presenter extends BasePresenter<Model, View> {
        public abstract void loginByPwd(String mobile, String pwd);

        public abstract void loginByCode(String mobile, String code);

        public abstract void getRecommendCode();

        public abstract void getLoginCode(String mobile);
    }
}
